package com.PAT.practice01;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/16/15:53
 * @Description:
 * @Target:
 */
public class 数素数 {


    // 先做一个判断素数的方法
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        OutMethod(scanner.nextInt(),scanner.nextInt());
    }



    public static void OutMethod(int start,int end){
        int count1 = 0;
        int count2 = 0;
        for (int i = 0; i < Integer.MAX_VALUE; i++) {
            if(IsOrNot(i)){
                count1++;


                if(count1>=start&&count1<end){
                    if (count2%10!=9){
                        System.out.print(i+" ");
                    }
                    if (count2%10==9){
                        System.out.print(i);
                        System.out.println();
                    }
                    count2++;
                }


            }


            if (count1==end){
                System.out.print(i);
                break;
            }


        }
    }


/*

    public static void OutMethod(int start,int end){
        int count = 0;
        for (int i = start; i < end; i++) {
            if(IsOrNot(i)){
                count++;
                if (count%10==0){
                    System.out.println();
                }
                System.out.print(i+" ");
            }
        }
    }

*/

    public static Boolean IsOrNot(int m){
        boolean flag = true;
        if (m==1 || m==0){
            flag = false;
        }
        for (int i = 2; i <= Math.sqrt(m); i++) {
            if (m%i==0){
                flag = false;
                break;
            }
        }
        return flag;
    }

}
